package com.ntschy.bt.entity.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonValue;


/**
 *
 * @author lxr
 *
 * 求助类型枚举类
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BtHelpHelpTypeEnum  implements IEnum<Integer> {


    /**
     * 求助类型：1 .项目建设-环评 2：项目建设-租赁企业入园申请 3:项目建设-技改申请备案4 :安全生产、5：要素保障 6 ：用工资金
     */

    ENVIRONMENTAL(1, "项目建设-环评"),
    LEASE(2, "项目建设-租赁企业入园申请"),
    RECORD(3, "项目建设-技改申请备案"),
    SAFE_PRODUCTION(4, "安全生产"),
    ELEMENT_GUARANTEE(5,"要素保障"),
    EMPLOYMENT_FUNDS(6,"用工资金");

//    @JsonValue
    private final int value;

//    @JsonValue
    private final String desc;

    BtHelpHelpTypeEnum(int value,String desc){
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }

    @JsonCreator
    public static BtHelpHelpTypeEnum getBtHelpHelpTypeFromValue(int value){
        for (BtHelpHelpTypeEnum examineResult : BtHelpHelpTypeEnum.values()){
            if(examineResult.getValue() == value){
                return examineResult;
            }
        }

        return  null;
    }

}
